//
// Created by 11510 on 2024/6/7.
//

#ifndef DEMO1_COMPUTER_H
#define DEMO1_COMPUTER_H

class Computer{
private:
    double _price;
    char *_brand;
    static Computer *_pInstance;
public:
    static Computer *getInstance();

    void init(double price, const char *brand);

    void toString() const;
    // 没有this指针
    static void destroy();
private:
    Computer(double price, const char *brand);
    ~Computer();
    Computer(Computer &rhs) = delete;
    Computer &operator=(const Computer& rhs) = delete;
};
#endif //DEMO1_COMPUTER_H
